<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../layui/jquery-3.2.1.min.js"></script>
    <script src="../layui/layui.js"></script>
    <link href="../layui/css/layui.css" rel="stylesheet">
    <script src="js/purchaseIn.js"></script>
    <link href="css/purchaseIn.css"  rel="stylesheet">
</head>

<body>
    <!--标题-->
    <h1 style="margin-left: 42%" >采购入库</h1>

    <!--采购栏基础信息-->
    <div id="purchaseBaseInfo">
        <span class="layui-text">供应商：</span>
        <select class="layui-select" style="margin-left: 10px" id="sup" onchange="showBySup()"></select>
        <span class="layui-text" style="margin-left: 50px">采购人：</span><span id="user" class="layui-text"></span>
    </div>

    <!--采购栏表格-->
    <div class="table">
        <table class="layui-table">
            <thead><tr><th>商品名称</th><th>厂家</th><th>建议采购价</th><th>建议销售价
            </th><th>采购数量</th><th>操作</th></tr></thead>
            <tbody id="productData"></tbody>
        </table>
        <a class="layui-btn layui-btn-warm" href="javascript:buy()">入库</a>
        <a class="layui-btn layui-btn-normal" href="javascript:showAdd()"><i class="layui-icon layui-icon-add-circle"></i>添加商品</a>
    </div>

    <!--添加商品弹出层-->
    <div id="formDiv" class="layui-form" style="display: none">
        <form class="layui-form " id="f1">
            <div style="display:flex;">

                <div style="width: 270px">
                    <div class="layui-form-item" style="margin-top: 15px">
                        <label class="layui-form-label">商品编号</label>
                        <div class="layui-input-block" >
                            <input type="number" name="id" id="proId" required   placeholder="请输入商品编号" autocomplete="off" class="layui-input" onblur="abc()">
                            <span name="check"></span>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">商品名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name"  id="proName" placeholder="请输入商品名称" autocomplete="off" class="layui-input" >
                            <span name="check" ></span>
                        </div>

                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">厂家</label>
                        <div class="layui-input-block">
                            <input type="text" name="vender" id="vender"  required  placeholder="请输入厂家" autocomplete="off" class="layui-input" >
                            <span name="check"></span>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">类别</label>
                        <div class="layui-input-block">
                            <select name="type" id="type">
                                <option>电脑产品</option>
                                <option>手机产品</option>
                                <option>其他数码产品</option>
                                <option>其他</option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">建议采购价</label>
                        <div class="layui-input-block">
                            <input type="number" name="buyPrice" id="buyPrice" required  placeholder="请输入建议采购价" autocomplete="off" class="layui-input" >
                            <span name="check"></span>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">建议销售价</label>
                        <div class="layui-input-block">
                            <input type="number" name="sellPrice" id="sellPrice"  required   placeholder="请输入建议销售价" autocomplete="off" class="layui-input"   >
                            <span name="check"></span>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">采购数量</label>
                        <div class="layui-input-block">
                            <input type="number" name="num" id="num"  required     placeholder="请输入采购数量" autocomplete="off" class="layui-input" >
                            <span name="check"></span>
                        </div>
                     </div>

            <div style="display: flex">
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn"    onclick="addProduct()">添加</button>
                    </div>
                </div>
                <!--供应商id和添加方法隐藏表单-->
                <div class="layui-form-item" >
                    <div class="layui-input-block" >
                        <input type="hidden" id="sup1"  name="supId"  style="width: 30px" required    autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item" >
                    <div class="layui-input-block">
                        <input type="hidden" id="method" name="method" style="width: 60px" required    autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
                </div>

            <div style="margin-top: 120px;margin-left: 80px">
                <div class="layui-form-item" style="width: 250px">
                    <div><img id="picture" src="../img/start.jpg"  style="width: 100px;height: 100px;margin-left: 17px"></div>
                    <div><input type="file" class="layui-icon layui-icon-search " name="img" id="img" style="margin-top: 30px;width: 150px;" onchange="upLoad(this)"></div>
                </div>
            </div>
            </div>
        </form>
    </div>
</body>
</html>